home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume11 / tcsh.4.3 / part02 < prev    next >
Encoding:
Text File  |  1987-09-27  |  60.3 KB  |  2,928 lines

  1. #! /bin/sh
  2. # This is a shell archive, meaning:
  3. # 1. Remove everything above the #! /bin/sh line.
  4. # 2. Save the resulting text in a file.
  5. # 3. Execute the file with /bin/sh (not csh) to create:
  6. #    DIFFS.2
  7. # This archive created: Thu Sep 24 16:28:19 1987
  8. export PATH; PATH=/bin:/usr/bin:$PATH
  9. if test -f 'DIFFS.2'
  10. then
  11.     echo shar: "will not over-write existing file 'DIFFS.2'"
  12. else
  13. cat << \SHAR_EOF > 'DIFFS.2'
  14. *** sh.glob.c    Tue May 13 01:27:18 1986
  15. --- /usr/src/local/tcsh/sh.glob.c    Mon Aug 17 21:32:21 1987
  16. ***************
  17. *** 9,15
  18.   #endif
  19.   
  20.   #include "sh.h"
  21. ! #include <sys/dir.h>
  22.   
  23.   /*
  24.    * C Shell
  25.  
  26. --- 9,15 -----
  27.   #endif
  28.   
  29.   #include "sh.h"
  30. ! /* #include <sys/dir.h> */
  31.   
  32.   /*
  33.    * C Shell
  34. ***************
  35. *** 118,123
  36.   sortscmp(a1, a2)
  37.       char **a1, **a2;
  38.   {
  39.   
  40.        return (strcmp(*a1, *a2));
  41.   }
  42.  
  43. --- 118,132 -----
  44.   sortscmp(a1, a2)
  45.       char **a1, **a2;
  46.   {
  47. +     if (!a1)            /* check for NULL */
  48. +         return (a2?1:0);
  49. +     if (!a2)
  50. +         return (-1);
  51. +     
  52. +     if (!*a1)            /* check for NULL */
  53. +         return (*a2?1:0);
  54. +     if (!*a2)
  55. +         return (-1);
  56.   
  57.        return (strcmp(*a1, *a2));
  58.   }
  59. ***************
  60. *** 131,136
  61.   
  62.       sgpathp = gpathp;
  63.       cs = as;
  64.       if (*cs == '~' && gpathp == gpath) {
  65.           addpath('~');
  66.           for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  67.  
  68. --- 140,164 -----
  69.   
  70.       sgpathp = gpathp;
  71.       cs = as;
  72. +     /*
  73. +      * kfk - 17 Jan 1984 - stack hack
  74. +      * allows user to get at arbitrary dir names in stack.
  75. +      */
  76. +     if (*cs == '=' && gpathp == gpath) {
  77. +         addpath ('=');
  78. +         if (digit (*++cs) || *cs == '-') {
  79. +             int dig;
  80. +             dig = (*cs == '-') ? -1 : *cs - '0';
  81. +             cs++;
  82. +             if (*cs && *cs != '/')
  83. +                 error ("Stack hack: =<dig>{/path...}");
  84. +             getstakd (gpath, dig, 1);
  85. +                 /* last "1" = call error if needed */
  86. +             gpathp = strend (gpath);
  87. +         }
  88. +     }
  89. +     /* kfk - end stack hack change */
  90.       if (*cs == '~' && gpathp == gpath) {
  91.           addpath('~');
  92.           for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  93. ***************
  94. *** 295,301
  95.       register char *sentp;
  96.       char sglobbed = globbed;
  97.   
  98. !     if (*s == '.' && *p != '.')
  99.           return (0);
  100.       sentp = entp;
  101.       entp = s;
  102.  
  103. --- 323,329 -----
  104.       register char *sentp;
  105.       char sglobbed = globbed;
  106.   
  107. !     if (*s == '.' && *p != '.') /* PWP: this makes [.]login != .login */
  108.           return (0);
  109.       sentp = entp;
  110.       entp = s;
  111. ***************
  112. *** 309,315
  113.       register char *s, *p;
  114.   {
  115.       register int scc;
  116. !     int ok, lc;
  117.       char *sgpathp;
  118.       struct stat stb;
  119.       int c, cc;
  120.  
  121. --- 337,343 -----
  122.       register char *s, *p;
  123.   {
  124.       register int scc;
  125. !     int ok, lc, notin;
  126.       char *sgpathp;
  127.       struct stat stb;
  128.       int c, cc;
  129. ***************
  130. *** 322,328
  131.           case '{':
  132.               return (execbrc(p - 1, s - 1));
  133.   
  134. !         case '[':
  135.               ok = 0;
  136.               lc = 077777;
  137.               while (cc = *p++) {
  138.  
  139. --- 350,357 -----
  140.           case '{':
  141.               return (execbrc(p - 1, s - 1));
  142.   
  143. !         case '[':    /* PWP -- BRACKET IS HERE!! */
  144. !             if (!scc) return 0; /* if at end if string */
  145.               ok = 0;
  146.               lc = 077777;
  147.               if (*p == '^') {
  148. ***************
  149. *** 325,330
  150.           case '[':
  151.               ok = 0;
  152.               lc = 077777;
  153.               while (cc = *p++) {
  154.                   if (cc == ']') {
  155.                       if (ok)
  156.  
  157. --- 354,364 -----
  158.               if (!scc) return 0; /* if at end if string */
  159.               ok = 0;
  160.               lc = 077777;
  161. +             if (*p == '^') {
  162. +                 notin = 1;
  163. +                 p++;
  164. +             } else
  165. +                 notin = 0;
  166.               while (cc = *p++) {
  167.                   if (cc == ']') {
  168.                       if (notin) { /* PWP for not in list */
  169. ***************
  170. *** 327,335
  171.               lc = 077777;
  172.               while (cc = *p++) {
  173.                   if (cc == ']') {
  174. !                     if (ok)
  175. !                         break;
  176. !                     return (0);
  177.                   }
  178.                   if (cc == '-') {
  179.                       if (lc <= scc && scc <= *p++)
  180.  
  181. --- 361,377 -----
  182.                   notin = 0;
  183.               while (cc = *p++) {
  184.                   if (cc == ']') {
  185. !                     if (notin) { /* PWP for not in list */
  186. !                         if (!ok)
  187. !                             break;
  188. !                         else
  189. !                             return (0);
  190. !                     } else {
  191. !                         if (ok)
  192. !                             break;
  193. !                         else
  194. !                             return (0);
  195. !                     }
  196.                   }
  197.                   if (cc == '-') {
  198.                       if (lc <= scc && scc <= *p++)
  199. ***************
  200. *** 335,341
  201.                       if (lc <= scc && scc <= *p++)
  202.                           ok++;
  203.                   } else
  204. !                     if (scc == (lc = cc))
  205.                           ok++;
  206.               }
  207.               if (cc == 0)
  208.  
  209. --- 377,383 -----
  210.                       if (lc <= scc && scc <= *p++)
  211.                           ok++;
  212.                   } else
  213. !                     if (scc && (scc == (lc = cc)))
  214.                           ok++;
  215.               }
  216.               if (cc == 0)
  217. ***************
  218. *** 393,399
  219.       register char *s, *p;
  220.   {
  221.       register int scc;
  222. !     int ok, lc;
  223.       int c, cc;
  224.   
  225.       for (;;) {
  226.  
  227. --- 435,441 -----
  228.       register char *s, *p;
  229.   {
  230.       register int scc;
  231. !     int ok, lc, notin;
  232.       int c, cc;
  233.   
  234.       for (;;) {
  235. ***************
  236. *** 400,406
  237.           scc = *s++ & TRIM;
  238.           switch (c = *p++) {
  239.   
  240. !         case '[':
  241.               ok = 0;
  242.               lc = 077777;
  243.               while (cc = *p++) {
  244.  
  245. --- 442,449 -----
  246.           scc = *s++ & TRIM;
  247.           switch (c = *p++) {
  248.   
  249. !         case '[':    /* PWP -- HERE TOO!! */
  250. !             if (!scc) return 0; /* if at end if string */
  251.               ok = 0;
  252.               lc = 077777;
  253.               if (*p == '^') {
  254. ***************
  255. *** 403,408
  256.           case '[':
  257.               ok = 0;
  258.               lc = 077777;
  259.               while (cc = *p++) {
  260.                   if (cc == ']') {
  261.                       if (ok)
  262.  
  263. --- 446,456 -----
  264.               if (!scc) return 0; /* if at end if string */
  265.               ok = 0;
  266.               lc = 077777;
  267. +             if (*p == '^') {
  268. +                 notin = 1;
  269. +                 p++;
  270. +             } else
  271. +                 notin = 0;
  272.               while (cc = *p++) {
  273.                   if (cc == ']') {
  274.                       if (notin) { /* PWP for not in list */
  275. ***************
  276. *** 405,410
  277.               lc = 077777;
  278.               while (cc = *p++) {
  279.                   if (cc == ']') {
  280.                       if (ok)
  281.                           break;
  282.                       return (0);
  283.  
  284. --- 453,464 -----
  285.                   notin = 0;
  286.               while (cc = *p++) {
  287.                   if (cc == ']') {
  288. +                     if (notin) { /* PWP for not in list */
  289. +                         if (!ok)
  290. +                         break;
  291. +                         else
  292. +                         return (0);
  293. +                     } else {
  294.                       if (ok)
  295.                           break;
  296.                           else
  297. ***************
  298. *** 407,412
  299.                   if (cc == ']') {
  300.                       if (ok)
  301.                           break;
  302.                       return (0);
  303.                   }
  304.                   if (cc == '-') {
  305.  
  306. --- 461,467 -----
  307.                       } else {
  308.                       if (ok)
  309.                           break;
  310. +                         else
  311.                       return (0);
  312.                   }
  313.                   }
  314. ***************
  315. *** 409,414
  316.                           break;
  317.                       return (0);
  318.                   }
  319.                   if (cc == '-') {
  320.                       if (lc <= scc && scc <= *p++)
  321.                           ok++;
  322.  
  323. --- 464,470 -----
  324.                           else
  325.                       return (0);
  326.                   }
  327. +                 }
  328.                   if (cc == '-') {
  329.                       if (lc <= scc && scc <= *p++)
  330.                           ok++;
  331. ***************
  332. *** 413,419
  333.                       if (lc <= scc && scc <= *p++)
  334.                           ok++;
  335.                   } else
  336. !                     if (scc == (lc = cc))
  337.                           ok++;
  338.               }
  339.               if (cc == 0)
  340.  
  341. --- 469,475 -----
  342.                       if (lc <= scc && scc <= *p++)
  343.                           ok++;
  344.                   } else
  345. !                     if (scc && (scc == (lc = cc)))
  346.                           ok++;
  347.               }
  348.               if (cc == 0)
  349. ***************
  350. *** 503,509
  351.       register char *p, c;
  352.   
  353.       while (p = *t++) {
  354. !         if (*p == '~')
  355.               gflag |= 2;
  356.           else if (*p == '{' && (p[1] == '\0' || p[1] == '}' && p[2] == '\0'))
  357.               continue;
  358.  
  359. --- 559,566 -----
  360.       register char *p, c;
  361.   
  362.       while (p = *t++) {
  363. !             /* added additional '=' test for stack hack */
  364. !         if ((*p == '~') || (*p == '='))
  365.               gflag |= 2;
  366.           else if (*p == '{' && (p[1] == '\0' || p[1] == '}' && p[2] == '\0'))
  367.               continue;
  368. *** sh.h    Sat Mar 29 07:37:09 1986
  369. --- /usr/src/local/tcsh/sh.h    Mon Aug 17 22:48:18 1987
  370. ***************
  371. *** 8,13
  372.   
  373.   #include <sys/time.h>
  374.   #include <sys/resource.h>
  375.   #include <sys/param.h>
  376.   #include <sys/stat.h>
  377.   #include <sys/signal.h>
  378.  
  379. --- 8,16 -----
  380.   
  381.   #include <sys/time.h>
  382.   #include <sys/resource.h>
  383. + #ifdef    SVID
  384. + #include <sys/types.h>
  385. + #endif
  386.   #include <sys/param.h>
  387.   #include <sys/stat.h>
  388.   #include <sys/signal.h>
  389. ***************
  390. *** 28,33
  391.   
  392.   #define    isdir(d)    ((d.st_mode & S_IFMT) == S_IFDIR)
  393.   
  394.   typedef    char    bool;
  395.   
  396.   #define    eq(a, b)    (strcmp(a, b) == 0)
  397.  
  398. --- 31,78 -----
  399.   
  400.   #define    isdir(d)    ((d.st_mode & S_IFMT) == S_IFDIR)
  401.   
  402. + #include <sys/ioctl.h>
  403. + #ifndef SVID
  404. + #include <sgtty.h>
  405. + #include <sys/dir.h>
  406. + #else SVID
  407. + # ifdef OREO
  408. + #include <sgtty.h>
  409. + #include <sys/dir.h>
  410. + # else OREO
  411. + #include "dir.h"
  412. + # endif OREO
  413. + #endif SVID
  414. + /* #include <ctype.h> */
  415. + #include <pwd.h>
  416. + #ifdef SVID
  417. + # ifndef pyr
  418. + #include <time.h>
  419. + # endif pyr
  420. + #include <termio.h>
  421. + #endif
  422. +     
  423. + /*
  424. +  * kfk 26 Jan 1984 - for login watch functions.
  425. +  */
  426. + #include <utmp.h>
  427. + struct who {
  428. +     struct who *w_next;
  429. +     struct who *w_prev;
  430. +     char w_name[10];
  431. +     char w_new[10];
  432. +     char w_tty[10];
  433. +     int w_status;
  434. + };
  435. + #define ONLINE        01
  436. + #define OFFLINE        02
  437. + #define CHANGED        04
  438. + #define ANNOUNCE    010
  439. + /* kfk - end change */
  440.   typedef    char    bool;
  441.   
  442.   /* kfk - additions to support scheduled commands */
  443. ***************
  444. *** 30,35
  445.   
  446.   typedef    char    bool;
  447.   
  448.   #define    eq(a, b)    (strcmp(a, b) == 0)
  449.   
  450.   /*
  451.  
  452. --- 75,89 -----
  453.   /* kfk - end change */
  454.   typedef    char    bool;
  455.   
  456. + /* kfk - additions to support scheduled commands */
  457. + struct sched_event {
  458. +     struct    sched_event    *t_next;
  459. +     long            t_when;
  460. +     char            **t_lex;
  461. + };
  462. + extern    long    time();
  463. + /* kfk - end change */
  464.   #define    eq(a, b)    (strcmp(a, b) == 0)
  465.   
  466.   /*
  467. ***************
  468. *** 51,59
  469.   bool    setintr;        /* Set interrupts on/off -> Wait intr... */
  470.   bool    timflg;            /* Time the next waited for command */
  471.   bool    havhash;        /* path hashing is available */
  472. - #ifdef FILEC
  473. - bool    filec;            /* doing filename expansion */
  474. - #endif
  475.   
  476.   /*
  477.    * Global i/o info
  478.  
  479. --- 105,110 -----
  480.   bool    setintr;        /* Set interrupts on/off -> Wait intr... */
  481.   bool    timflg;            /* Time the next waited for command */
  482.   bool    havhash;        /* path hashing is available */
  483.   
  484.   /*
  485.    * Global i/o info
  486. ***************
  487. *** 66,71
  488.   int    errno;            /* Error from C library routines */
  489.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  490.   struct    timeval time0;        /* Time at which the shell started */
  491.   struct    rusage ru0;
  492.   
  493.   /*
  494.  
  495. --- 117,123 -----
  496.   int    errno;            /* Error from C library routines */
  497.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  498.   struct    timeval time0;        /* Time at which the shell started */
  499. + #ifndef OREO
  500.   struct    rusage ru0;
  501.   #endif OREO
  502.   
  503. ***************
  504. *** 67,72
  505.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  506.   struct    timeval time0;        /* Time at which the shell started */
  507.   struct    rusage ru0;
  508.   
  509.   /*
  510.    * Miscellany
  511.  
  512. --- 119,125 -----
  513.   struct    timeval time0;        /* Time at which the shell started */
  514.   #ifndef OREO
  515.   struct    rusage ru0;
  516. + #endif OREO
  517.   
  518.   /*
  519.    * Miscellany
  520. ***************
  521. *** 79,84
  522.   /* If tpgrp is -1, leave tty alone! */
  523.   int    opgrp;            /* Initial pgrp and tty pgrp */
  524.   int    oldisc;            /* Initial line discipline or -1 */
  525.   
  526.   /*
  527.    * These are declared here because they want to be
  528.  
  529. --- 132,140 -----
  530.   /* If tpgrp is -1, leave tty alone! */
  531.   int    opgrp;            /* Initial pgrp and tty pgrp */
  532.   int    oldisc;            /* Initial line discipline or -1 */
  533. + char PromptBuf[256];        /* buffer for the actual printed prompt.
  534. +                    this is used in tenex.c and sh.c for
  535. +                    pegets.c */
  536.   
  537.   /*
  538.    * These are declared here because they want to be
  539. ***************
  540. *** 369,374
  541.       struct    wordent Hlex;
  542.       int    Hnum;
  543.       int    Href;
  544.       struct    Hist *Hnext;
  545.   } Histlist;
  546.   
  547.  
  548. --- 425,431 -----
  549.       struct    wordent Hlex;
  550.       int    Hnum;
  551.       int    Href;
  552. +     long    Htime;
  553.       struct    Hist *Hnext;
  554.   } Histlist;
  555.   
  556. ***************
  557. *** 423,428
  558.   char    *index();
  559.   struct    biltins *isbfunc();
  560.   off_t    lseek();
  561.   char    *operate();
  562.   int    phup();
  563.   int    pintr();
  564.  
  565. --- 480,486 -----
  566.   char    *index();
  567.   struct    biltins *isbfunc();
  568.   off_t    lseek();
  569. + struct    tm *localtime();
  570.   char    *operate();
  571.   int    phup();
  572.   int    pintr();
  573. ***************
  574. *** 471,473
  575.       char    *iname;        /* name from /usr/include */
  576.       char    *pname;        /* print name */
  577.   } mesg[];
  578.  
  579. --- 529,534 -----
  580.       char    *iname;        /* name from /usr/include */
  581.       char    *pname;        /* print name */
  582.   } mesg[];
  583. + #define    sighold(sig)    sigblock(sigmask(sig))
  584. +     
  585. *** sh.hist.c    Thu Jun  6 13:15:33 1985
  586. --- /usr/src/local/tcsh/sh.hist.c    Mon Aug 17 21:32:24 1987
  587. ***************
  588. *** 53,58
  589.       register struct Hist *np;
  590.   
  591.       np = (struct Hist *) xalloc(sizeof *np);
  592.       np->Hnum = np->Href = event;
  593.       if (docopy)
  594.           copylex(&np->Hlex, lp);
  595.  
  596. --- 53,59 -----
  597.       register struct Hist *np;
  598.   
  599.       np = (struct Hist *) xalloc(sizeof *np);
  600. +     time(&(np->Htime));
  601.       np->Hnum = np->Href = event;
  602.       if (docopy)
  603.           copylex(&np->Hlex, lp);
  604. ***************
  605. *** 135,140
  606.       register struct Hist *hp;
  607.       int hflg;
  608.   {
  609.   
  610.       if (hflg == 0)
  611.           printf("%6d\t", hp->Hnum);
  612.  
  613. --- 136,143 -----
  614.       register struct Hist *hp;
  615.       int hflg;
  616.   {
  617. +     struct tm *t;
  618. +     char ampm = 'a';
  619.   
  620.       if (hflg == 0)
  621.       {
  622. ***************
  623. *** 137,142
  624.   {
  625.   
  626.       if (hflg == 0)
  627.           printf("%6d\t", hp->Hnum);
  628.       prlex(&hp->Hlex);
  629.   }
  630.  
  631. --- 140,146 -----
  632.       char ampm = 'a';
  633.   
  634.       if (hflg == 0)
  635. +     {
  636.           printf("%6d\t", hp->Hnum);
  637.           t = localtime(&hp->Htime);
  638.           if (t->tm_hour >= 12)
  639. ***************
  640. *** 138,142
  641.   
  642.       if (hflg == 0)
  643.           printf("%6d\t", hp->Hnum);
  644.       prlex(&hp->Hlex);
  645.   }
  646.  
  647. --- 142,157 -----
  648.       if (hflg == 0)
  649.       {
  650.           printf("%6d\t", hp->Hnum);
  651. +         t = localtime(&hp->Htime);
  652. +         if (t->tm_hour >= 12)
  653. +         {
  654. +             if (t->tm_hour > 12)
  655. +                 t->tm_hour -= 12;
  656. +             ampm = 'p';
  657. +         }
  658. +         else if (t->tm_hour == 0)
  659. +             t->tm_hour = 12;
  660. +         printf ("%2d:%02d%cm\t", t->tm_hour, t->tm_min, ampm);
  661. +     }
  662.       prlex(&hp->Hlex);
  663.   }
  664. *** sh.init.c    Thu Jun  6 13:15:48 1985
  665. --- /usr/src/local/tcsh/sh.init.c    Tue Aug 18 21:57:22 1987
  666. ***************
  667. *** 16,21
  668.   
  669.   extern    int doalias();
  670.   extern    int dobg();
  671.   extern    int dobreak();
  672.   extern    int dochngd();
  673.   extern    int docontin();
  674.  
  675. --- 16,22 -----
  676.   
  677.   extern    int doalias();
  678.   extern    int dobg();
  679. + extern    int dobind();
  680.   extern    int dobreak();
  681.   extern    int dochngd();
  682.   extern    int docontin();
  683. ***************
  684. *** 37,42
  685.   extern    int dojobs();
  686.   extern    int dokill();
  687.   extern    int dolet();
  688.   extern    int dolimit();
  689.   extern    int dologin();
  690.   extern    int dologout();
  691.  
  692. --- 38,44 -----
  693.   extern    int dojobs();
  694.   extern    int dokill();
  695.   extern    int dolet();
  696. + #ifndef OREO
  697.   extern    int dolimit();
  698.   #endif
  699.   extern    int dolog();
  700. ***************
  701. *** 38,43
  702.   extern    int dokill();
  703.   extern    int dolet();
  704.   extern    int dolimit();
  705.   extern    int dologin();
  706.   extern    int dologout();
  707.   #ifdef NEWGRP
  708.  
  709. --- 40,47 -----
  710.   extern    int dolet();
  711.   #ifndef OREO
  712.   extern    int dolimit();
  713. + #endif
  714. + extern    int dolog();
  715.   extern    int dologin();
  716.   extern    int dologout();
  717.   #ifdef NEWGRP
  718. ***************
  719. *** 50,55
  720.   extern    int dopopd();
  721.   extern    int dopushd();
  722.   extern    int dorepeat();
  723.   extern    int doset();
  724.   extern    int dosetenv();
  725.   extern    int dosource();
  726.  
  727. --- 54,60 -----
  728.   extern    int dopopd();
  729.   extern    int dopushd();
  730.   extern    int dorepeat();
  731. + extern    int dosched();
  732.   extern    int doset();
  733.   extern    int dosetenv();
  734.   extern    int dosource();
  735. ***************
  736. *** 58,63
  737.   extern    int doswbrk();
  738.   extern    int doswitch();
  739.   extern    int dotime();
  740.   extern    int dounlimit();
  741.   extern    int doumask();
  742.   extern    int dowait();
  743.  
  744. --- 63,69 -----
  745.   extern    int doswbrk();
  746.   extern    int doswitch();
  747.   extern    int dotime();
  748. + #ifndef OREO
  749.   extern    int dounlimit();
  750.   #endif
  751.   extern    int doumask();
  752. ***************
  753. *** 59,64
  754.   extern    int doswitch();
  755.   extern    int dotime();
  756.   extern    int dounlimit();
  757.   extern    int doumask();
  758.   extern    int dowait();
  759.   extern    int dowhile();
  760.  
  761. --- 65,71 -----
  762.   extern    int dotime();
  763.   #ifndef OREO
  764.   extern    int dounlimit();
  765. + #endif
  766.   extern    int doumask();
  767.   extern    int dowait();
  768.   extern    int dowhile();
  769. ***************
  770. *** 74,79
  771.   extern    int dounhash();
  772.   extern    int unset();
  773.   extern    int dounsetenv();
  774.   
  775.   #define    INF    1000
  776.   
  777.  
  778. --- 81,87 -----
  779.   extern    int dounhash();
  780.   extern    int unset();
  781.   extern    int dounsetenv();
  782. + extern    int dolist();        /* for ls-F */
  783.   
  784.   #define    INF    1000
  785.   
  786. ***************
  787. *** 86,91
  788.       "alias",    doalias,    0,    INF,
  789.       "alloc",    showall,    0,    1,
  790.       "bg",        dobg,        0,    INF,
  791.       "break",    dobreak,    0,    0,
  792.       "breaksw",    doswbrk,    0,    0,
  793.   #ifdef IIASA
  794.  
  795. --- 94,100 -----
  796.       "alias",    doalias,    0,    INF,
  797.       "alloc",    showall,    0,    1,
  798.       "bg",        dobg,        0,    INF,
  799. +     "bind",        dobind,        0,    2,
  800.       "break",    dobreak,    0,    0,
  801.       "breaksw",    doswbrk,    0,    0,
  802.   #ifdef IIASA
  803. ***************
  804. *** 119,124
  805.       "if",        doif,        1,    INF,
  806.       "jobs",        dojobs,        0,    1,
  807.       "kill",        dokill,        1,    INF,
  808.       "limit",    dolimit,    0,    3,
  809.       "login",    dologin,    0,    1,
  810.       "logout",    dologout,    0,    0,
  811.  
  812. --- 128,134 -----
  813.       "if",        doif,        1,    INF,
  814.       "jobs",        dojobs,        0,    1,
  815.       "kill",        dokill,        1,    INF,
  816. + #ifndef OREO
  817.       "limit",    dolimit,    0,    3,
  818.   #endif OREO
  819.       "linedit",    doecho,        0,    INF,
  820. ***************
  821. *** 120,125
  822.       "jobs",        dojobs,        0,    1,
  823.       "kill",        dokill,        1,    INF,
  824.       "limit",    dolimit,    0,    3,
  825.       "login",    dologin,    0,    1,
  826.       "logout",    dologout,    0,    0,
  827.   #ifdef NEWGRP
  828.  
  829. --- 130,138 -----
  830.       "kill",        dokill,        1,    INF,
  831.   #ifndef OREO
  832.       "limit",    dolimit,    0,    3,
  833. + #endif OREO
  834. +     "linedit",    doecho,        0,    INF,
  835. +     "log",        dolog,        0,    0,
  836.       "login",    dologin,    0,    1,
  837.       "logout",    dologout,    0,    0,
  838.       "ls-F",        dolist,        0,    INF,
  839. ***************
  840. *** 122,127
  841.       "limit",    dolimit,    0,    3,
  842.       "login",    dologin,    0,    1,
  843.       "logout",    dologout,    0,    0,
  844.   #ifdef NEWGRP
  845.       "newgrp",    donewgrp,    1,    1,
  846.   #endif
  847.  
  848. --- 135,141 -----
  849.       "log",        dolog,        0,    0,
  850.       "login",    dologin,    0,    1,
  851.       "logout",    dologout,    0,    0,
  852. +     "ls-F",        dolist,        0,    INF,
  853.   #ifdef NEWGRP
  854.       "newgrp",    donewgrp,    1,    1,
  855.   #endif
  856. ***************
  857. *** 136,141
  858.   #endif
  859.       "rehash",    dohash,        0,    0,
  860.       "repeat",    dorepeat,    2,    INF,
  861.       "set",        doset,        0,    INF,
  862.       "setenv",    dosetenv,    0,    2,
  863.       "shift",    shift,        0,    1,
  864.  
  865. --- 150,156 -----
  866.   #endif
  867.       "rehash",    dohash,        0,    0,
  868.       "repeat",    dorepeat,    2,    INF,
  869. +     "sched",    dosched,    0,    INF,
  870.       "set",        doset,        0,    INF,
  871.       "setenv",    dosetenv,    0,    2,
  872.       "shift",    shift,        0,    1,
  873. ***************
  874. *** 147,152
  875.       "umask",    doumask,    0,    1,
  876.       "unalias",    unalias,    1,    INF,
  877.       "unhash",    dounhash,    0,    0,
  878.       "unlimit",    dounlimit,    0,    INF,
  879.       "unset",    unset,        1,    INF,
  880.       "unsetenv",    dounsetenv,    1,    INF,
  881.  
  882. --- 162,168 -----
  883.       "umask",    doumask,    0,    1,
  884.       "unalias",    unalias,    1,    INF,
  885.       "unhash",    dounhash,    0,    0,
  886. + #ifndef OREO
  887.       "unlimit",    dounlimit,    0,    INF,
  888.   #endif
  889.       "unset",    unset,        1,    INF,
  890. ***************
  891. *** 148,153
  892.       "unalias",    unalias,    1,    INF,
  893.       "unhash",    dounhash,    0,    0,
  894.       "unlimit",    dounlimit,    0,    INF,
  895.       "unset",    unset,        1,    INF,
  896.       "unsetenv",    dounsetenv,    1,    INF,
  897.       "wait",        dowait,        0,    0,
  898.  
  899. --- 164,170 -----
  900.       "unhash",    dounhash,    0,    0,
  901.   #ifndef OREO
  902.       "unlimit",    dounlimit,    0,    INF,
  903. + #endif
  904.       "unset",    unset,        1,    INF,
  905.       "unsetenv",    dounsetenv,    1,    INF,
  906.       "wait",        dowait,        0,    0,
  907. ***************
  908. *** 219,224
  909.       "PIPE",    "Broken pipe",
  910.       "ALRM",    "Alarm clock",
  911.       "TERM",    "Terminated",
  912.       "URG",    "Urgent I/O condition",
  913.       "STOP",    "Stopped (signal)",
  914.       "TSTP",    "Stopped",
  915.  
  916. --- 236,243 -----
  917.       "PIPE",    "Broken pipe",
  918.       "ALRM",    "Alarm clock",
  919.       "TERM",    "Terminated",
  920. + #ifdef SVID
  921. + # ifdef pyr            /* these are really the BSD sigs, plus a few */
  922.       "URG",    "Urgent I/O condition",
  923.       "STOP",    "Stopped (signal)",
  924.       "TSTP",    "Stopped",
  925. ***************
  926. *** 226,232
  927.       "CHLD",    "Child exited",
  928.       "TTIN", "Stopped (tty input)",
  929.       "TTOU", "Stopped (tty output)",
  930. !     "IO",    "I/O possible",
  931.       "XCPU",    "Cputime limit exceeded",
  932.       "XFSZ", "Filesize limit exceeded",
  933.       "VTALRM","Virtual timer expired",
  934.  
  935. --- 245,251 -----
  936.       "CHLD",    "Child exited",
  937.       "TTIN", "Stopped (tty input)",
  938.       "TTOU", "Stopped (tty output)",
  939. !     "IO",   "I/O possible",
  940.       "XCPU",    "Cputime limit exceeded",
  941.       "XFSZ", "Filesize limit exceeded",
  942.       "VTALRM", "Virtual time alarm",
  943. ***************
  944. *** 229,237
  945.       "IO",    "I/O possible",
  946.       "XCPU",    "Cputime limit exceeded",
  947.       "XFSZ", "Filesize limit exceeded",
  948. !     "VTALRM","Virtual timer expired",
  949. !     "PROF",    "Profiling timer expired",
  950. !     "WINCH","Window size changed",
  951.       0,    "Signal 29",
  952.       "USR1",    "User defined signal 1",
  953.       "USR2",    "User defined signal 2",
  954.  
  955. --- 248,286 -----
  956.       "IO",   "I/O possible",
  957.       "XCPU",    "Cputime limit exceeded",
  958.       "XFSZ", "Filesize limit exceeded",
  959. !     "VTALRM", "Virtual time alarm",
  960. !     "PROF",    "Profiling time alarm",
  961. !     "USR1",    "User signal 1",
  962. !     "USR2",    "User signal 2",
  963. !     "PWR",    "Power failure",
  964. !     0,    "Signal 31",
  965. !     0,    "Signal 32"
  966. ! # else pyr            /* the first four real SVID sigs. */
  967. !     "USR1",    "User signal 1",
  968. !     "USR2", "User signal 2",
  969. !     "CHLD",    "Child exited",
  970. !     "PWR",  "Power failure",
  971. ! #  ifdef OREO
  972. !     "TSTP",    "Stopped",
  973. !     "TTIN", "Stopped (tty input)",
  974. !     "TTOU", "Stopped (tty output)",
  975. !     "STOP",    "Stopped (signal)",
  976. !     "XCPU",    "Cputime limit exceeded",
  977. !     "XFSZ", "Filesize limit exceeded",
  978. !     "VTALRM", "Virtual time alarm",
  979. !     "PROF", "Profiling time alarm",
  980. !     "WINCH", "Window size changed",
  981. !     "CONT",    "Continued",
  982. ! #  else OREO
  983. !     0,    "Signal 20",
  984. !     0,    "Signal 21",
  985. !     0,    "Signal 22",
  986. !     0,    "Signal 23",
  987. !     0,    "Signal 24",
  988. !     0,    "Signal 25",
  989. !     0,    "Signal 26",
  990. !     0,    "Signal 27",
  991. !     0,    "Signal 28",
  992.       0,    "Signal 29",
  993.   #  endif OREO
  994.       0,    "Signal 30",
  995. ***************
  996. *** 233,238
  997.       "PROF",    "Profiling timer expired",
  998.       "WINCH","Window size changed",
  999.       0,    "Signal 29",
  1000.       "USR1",    "User defined signal 1",
  1001.       "USR2",    "User defined signal 2",
  1002.       0,    "Signal 32"
  1003.  
  1004. --- 282,321 -----
  1005.       0,    "Signal 27",
  1006.       0,    "Signal 28",
  1007.       0,    "Signal 29",
  1008. + #  endif OREO
  1009. +     0,    "Signal 30",
  1010. +     0,    "Signal 31",
  1011. +     0,    "Signal 32"
  1012. + # endif pyr
  1013. + #else SVID
  1014. +     "URG",    "Urgent I/O condition",
  1015. +     "STOP",    "Stopped (signal)",
  1016. +     "TSTP",    "Stopped",
  1017. +     "CONT",    "Continued",
  1018. +     "CHLD",    "Child exited",
  1019. +     "TTIN", "Stopped (tty input)",
  1020. +     "TTOU", "Stopped (tty output)",
  1021. +     "IO",   "I/O possible",
  1022. +     "XCPU",    "Cputime limit exceeded",
  1023. +     "XFSZ", "Filesize limit exceeded",
  1024. +     "VTALRM", "Virtual time alarm",
  1025. +     "PROF",    "Profiling time alarm",
  1026. + # ifdef sun
  1027. +     "WINCH", "Window size changed",
  1028. +     "LOST",    "Resource lost",
  1029. +     "USR1",    "User signal 1",
  1030. +     "USR2",    "User signal 2",
  1031. +     0,    "Signal 32"
  1032. + # else sun
  1033. + #  ifdef pyr
  1034. +     "USR1",    "User signal 1",
  1035. +     "USR2",    "User signal 2",
  1036. +     "PWR",    "Power failure",
  1037. +     0,    "Signal 31",
  1038. +     0,    "Signal 32"
  1039. + #  else pyr
  1040. +     "WINCH", "Window size changed",
  1041. +     0,    "Signal 29",
  1042.       "USR1",    "User defined signal 1",
  1043.       "USR2",    "User defined signal 2",
  1044.       0,    "Signal 32"
  1045. ***************
  1046. *** 236,239
  1047.       "USR1",    "User defined signal 1",
  1048.       "USR2",    "User defined signal 2",
  1049.       0,    "Signal 32"
  1050.   };
  1051.  
  1052. --- 319,325 -----
  1053.       "USR1",    "User defined signal 1",
  1054.       "USR2",    "User defined signal 2",
  1055.       0,    "Signal 32"
  1056. + #  endif pyr
  1057. + # endif sun
  1058. + #endif SVID
  1059.   };
  1060. *** sh.lex.c    Sat Mar 29 07:38:02 1986
  1061. --- /usr/src/local/tcsh/sh.lex.c    Thu Sep 17 23:23:42 1987
  1062. ***************
  1063. *** 9,15
  1064.   #endif
  1065.   
  1066.   #include "sh.h"
  1067. - #include <sgtty.h>
  1068.   
  1069.   /*
  1070.    * C shell
  1071.  
  1072. --- 9,14 -----
  1073.   #endif
  1074.   
  1075.   #include "sh.h"
  1076.   
  1077.   /*
  1078.    * C shell
  1079. ***************
  1080. *** 221,234
  1081.                       c |= QUOTE;
  1082.                   else {
  1083.                       if (c == '\n')
  1084. !                         /*
  1085. !                         if (c1 == '`')
  1086. !                             c = ' ';
  1087. !                         else
  1088. !                         */
  1089. !                             c |= QUOTE;
  1090. !                     ungetC(c);
  1091. !                     c = '\\';
  1092.                   }
  1093.               } else if (c == '\n') {
  1094.                   seterrc("Unmatched ", c1);
  1095.  
  1096. --- 220,234 -----
  1097.                       c |= QUOTE;
  1098.                   else {
  1099.                       if (c == '\n')
  1100. !                         c |= QUOTE;
  1101. !                     else if (c == '"')
  1102. !                         c |= QUOTE;
  1103. !                     else if (c == '\'')
  1104. !                         c |= QUOTE;
  1105. !                     else {
  1106. !                         ungetC(c);
  1107. !                         c = '\\';
  1108. !                     }
  1109.                   }
  1110.               } else if (c == '\n') {
  1111.                   seterrc("Unmatched ", c1);
  1112. ***************
  1113. *** 1126,1131
  1114.   reread:
  1115.           c = bgetc();
  1116.           if (c < 0) {
  1117.               struct sgttyb tty;
  1118.   
  1119.               if (wanteof)
  1120.  
  1121. --- 1126,1135 -----
  1122.   reread:
  1123.           c = bgetc();
  1124.           if (c < 0) {
  1125. + #ifdef    SVID
  1126. + #include <termio.h>
  1127. +             struct termio tty;
  1128. + #else
  1129.               struct sgttyb tty;
  1130.   #endif SVID
  1131.   
  1132. ***************
  1133. *** 1127,1132
  1134.           c = bgetc();
  1135.           if (c < 0) {
  1136.               struct sgttyb tty;
  1137.   
  1138.               if (wanteof)
  1139.                   return (-1);
  1140.  
  1141. --- 1131,1137 -----
  1142.               struct termio tty;
  1143.   #else
  1144.               struct sgttyb tty;
  1145. + #endif SVID
  1146.   
  1147.               if (wanteof)
  1148.                   return (-1);
  1149. ***************
  1150. *** 1131,1136
  1151.               if (wanteof)
  1152.                   return (-1);
  1153.               /* was isatty but raw with ignoreeof yields problems */
  1154.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1155.                   (tty.sg_flags & RAW) == 0) {
  1156.                   /* was 'short' for FILEC */
  1157.  
  1158. --- 1136,1145 -----
  1159.               if (wanteof)
  1160.                   return (-1);
  1161.               /* was isatty but raw with ignoreeof yields problems */
  1162. + #ifdef SVID
  1163. +             if (ioctl(SHIN, TCGETA, &tty)==0 &&
  1164. +                 (tty.c_cc[VEOF] != CEOF)) {
  1165. + #else SVID
  1166.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1167.                   (tty.sg_flags & RAW) == 0) {
  1168.   #endif
  1169. ***************
  1170. *** 1133,1139
  1171.               /* was isatty but raw with ignoreeof yields problems */
  1172.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1173.                   (tty.sg_flags & RAW) == 0) {
  1174. !                 /* was 'short' for FILEC */
  1175.                   int ctpgrp;
  1176.   
  1177.                   if (++sincereal > 25)
  1178.  
  1179. --- 1142,1148 -----
  1180.   #else SVID
  1181.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1182.                   (tty.sg_flags & RAW) == 0) {
  1183. ! #endif
  1184.                   int ctpgrp;
  1185.   
  1186.                   if (++sincereal > 25)
  1187. ***************
  1188. *** 1138,1143
  1189.   
  1190.                   if (++sincereal > 25)
  1191.                       goto oops;
  1192.                   if (tpgrp != -1 &&
  1193.                       ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp) == 0 &&
  1194.                       tpgrp != ctpgrp) {
  1195.  
  1196. --- 1147,1153 -----
  1197.   
  1198.                   if (++sincereal > 25)
  1199.                       goto oops;
  1200. + #ifdef BSDJOBS
  1201.                   if (tpgrp != -1 &&
  1202.                       ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp) == 0 &&
  1203.                       tpgrp != ctpgrp) {
  1204. ***************
  1205. *** 1147,1152
  1206.   printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1207.                       goto reread;
  1208.                   }
  1209.                   if (adrof("ignoreeof")) {
  1210.                       if (loginsh)
  1211.                           printf("\nUse \"logout\" to logout.\n");
  1212.  
  1213. --- 1157,1163 -----
  1214.   printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1215.                       goto reread;
  1216.                   }
  1217. + #endif BSDJOBS
  1218.                   if (adrof("ignoreeof")) {
  1219.                       if (loginsh)
  1220.                           printf("\nUse \"logout\" to logout.\n");
  1221. ***************
  1222. *** 1151,1157
  1223.                       if (loginsh)
  1224.                           printf("\nUse \"logout\" to logout.\n");
  1225.                       else
  1226. !                         printf("\nUse \"exit\" to leave csh.\n");
  1227.                       reset();
  1228.                   }
  1229.                   if (chkstop == 0)
  1230.  
  1231. --- 1162,1168 -----
  1232.                       if (loginsh)
  1233.                           printf("\nUse \"logout\" to logout.\n");
  1234.                       else
  1235. !                         printf("\nUse \"exit\" to leave tcsh.\n");
  1236.                       reset();
  1237.                   }
  1238.                   if (chkstop == 0)
  1239. ***************
  1240. *** 1171,1178
  1241.   bgetc()
  1242.   {
  1243.       register int buf, off, c;
  1244. ! #ifdef FILEC
  1245. !     char ttyline[BUFSIZ];
  1246.       register int numleft = 0, roomleft;
  1247.   #endif
  1248.   
  1249.  
  1250. --- 1182,1188 -----
  1251.   bgetc()
  1252.   {
  1253.       register int buf, off, c;
  1254. !     extern char InputBuf[];
  1255.       register int numleft = 0, roomleft;
  1256.   
  1257.   #ifdef TELL
  1258. ***************
  1259. *** 1174,1180
  1260.   #ifdef FILEC
  1261.       char ttyline[BUFSIZ];
  1262.       register int numleft = 0, roomleft;
  1263. - #endif
  1264.   
  1265.   #ifdef TELL
  1266.       if (cantell) {
  1267.  
  1268. --- 1184,1189 -----
  1269.       register int buf, off, c;
  1270.       extern char InputBuf[];
  1271.       register int numleft = 0, roomleft;
  1272.   
  1273.   #ifdef TELL
  1274.       if (cantell) {
  1275. ***************
  1276. *** 1187,1193
  1277.               do
  1278.                   c = read(SHIN, fbuf[0], BUFSIZ);
  1279.               while (c < 0 && errno == EINTR);
  1280. !             if (c <= 0)
  1281.                   return (-1);
  1282.               feobp += c;
  1283.           }
  1284.  
  1285. --- 1196,1202 -----
  1286.               do
  1287.                   c = read(SHIN, fbuf[0], BUFSIZ);
  1288.               while (c < 0 && errno == EINTR);
  1289. !             if (c <= 0) {
  1290.                   return (-1);
  1291.               }
  1292.               feobp += c;
  1293. ***************
  1294. *** 1189,1194
  1295.               while (c < 0 && errno == EINTR);
  1296.               if (c <= 0)
  1297.                   return (-1);
  1298.               feobp += c;
  1299.           }
  1300.           c = fbuf[0][fseekp - fbobp];
  1301.  
  1302. --- 1198,1204 -----
  1303.               while (c < 0 && errno == EINTR);
  1304.               if (c <= 0) {
  1305.                   return (-1);
  1306. +             }
  1307.               feobp += c;
  1308.           }
  1309.           c = fbuf[0][fseekp - fbobp];
  1310. ***************
  1311. *** 1210,1216
  1312.           fbuf = nfbuf;
  1313.           fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1314.           fblocks++;
  1315. !         goto again;
  1316.       }
  1317.       if (fseekp >= feobp) {
  1318.           buf = (int) feobp / BUFSIZ;
  1319.  
  1320. --- 1220,1227 -----
  1321.           fbuf = nfbuf;
  1322.           fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1323.           fblocks++;
  1324. !         if (!intty)
  1325. !             goto again;
  1326.       }
  1327.       if (fseekp >= feobp) {
  1328.           buf = (int) feobp / BUFSIZ;
  1329. ***************
  1330. *** 1215,1221
  1331.       if (fseekp >= feobp) {
  1332.           buf = (int) feobp / BUFSIZ;
  1333.           off = (int) feobp % BUFSIZ;
  1334. ! #ifndef FILEC
  1335.           for (;;) {
  1336.               c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1337.   #else
  1338.  
  1339. --- 1226,1232 -----
  1340.       if (fseekp >= feobp) {
  1341.           buf = (int) feobp / BUFSIZ;
  1342.           off = (int) feobp % BUFSIZ;
  1343. !          roomleft = BUFSIZ - off;
  1344.           for (;;) {
  1345.               if (intty) {     /* then use twenex routine */
  1346.                   /* PWP: get a line */
  1347. ***************
  1348. *** 1217,1234
  1349.           off = (int) feobp % BUFSIZ;
  1350.   #ifndef FILEC
  1351.           for (;;) {
  1352. !             c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1353. ! #else
  1354. !         roomleft = BUFSIZ - off;
  1355. !         for (;;) {
  1356. !             if (filec && intty) {
  1357. !                 c = numleft ? numleft : tenex(ttyline, BUFSIZ);
  1358. !                 if (c > roomleft) {
  1359. !                     /* start with fresh buffer */
  1360. !                     feobp = fseekp = fblocks * BUFSIZ;
  1361. !                     numleft = c;
  1362. !                     goto again;
  1363. !                 }
  1364.                   if (c > 0)
  1365.                       copy(fbuf[buf] + off, ttyline, c);
  1366.                   numleft = 0;
  1367.  
  1368. --- 1228,1244 -----
  1369.           off = (int) feobp % BUFSIZ;
  1370.            roomleft = BUFSIZ - off;
  1371.           for (;;) {
  1372. !             if (intty) {     /* then use twenex routine */
  1373. !                 /* PWP: get a line */
  1374. !                 c = numleft ? numleft : Inputl();
  1375. !                 if (c > roomleft) /* No room in this buffer? */
  1376. !                     {
  1377. !                         /* start with fresh buffer */
  1378. !                         feobp = fseekp =
  1379. !                             fblocks * BUFSIZ;
  1380. !                         numleft = c;
  1381. !                         goto again;
  1382. !                     }
  1383.                   if (c > 0)
  1384.                       copy (fbuf[buf] + off, InputBuf, c);
  1385.                   /* copy (fbuf[buf] + off, ttyline, c); */
  1386. ***************
  1387. *** 1230,1236
  1388.                       goto again;
  1389.                   }
  1390.                   if (c > 0)
  1391. !                     copy(fbuf[buf] + off, ttyline, c);
  1392.                   numleft = 0;
  1393.               } else
  1394.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1395.  
  1396. --- 1240,1247 -----
  1397.                           goto again;
  1398.                       }
  1399.                   if (c > 0)
  1400. !                     copy (fbuf[buf] + off, InputBuf, c);
  1401. !                 /* copy (fbuf[buf] + off, ttyline, c); */
  1402.                   numleft = 0;
  1403.               }
  1404.               else {
  1405. ***************
  1406. *** 1232,1238
  1407.                   if (c > 0)
  1408.                       copy(fbuf[buf] + off, ttyline, c);
  1409.                   numleft = 0;
  1410. !             } else
  1411.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1412.   #endif
  1413.               if (c >= 0)
  1414.  
  1415. --- 1243,1250 -----
  1416.                       copy (fbuf[buf] + off, InputBuf, c);
  1417.                   /* copy (fbuf[buf] + off, ttyline, c); */
  1418.                   numleft = 0;
  1419. !             }
  1420. !             else {
  1421.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1422.               }
  1423.               if (c >= 0)
  1424. ***************
  1425. *** 1234,1240
  1426.                   numleft = 0;
  1427.               } else
  1428.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1429. ! #endif
  1430.               if (c >= 0)
  1431.                   break;
  1432.               if (errno == EWOULDBLOCK) {
  1433.  
  1434. --- 1246,1252 -----
  1435.               }
  1436.               else {
  1437.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1438. !             }
  1439.               if (c >= 0)
  1440.                   break;
  1441.               if (errno == EWOULDBLOCK) {
  1442. ***************
  1443. *** 1239,1245
  1444.                   break;
  1445.               if (errno == EWOULDBLOCK) {
  1446.                   int off = 0;
  1447.                   (void) ioctl(SHIN, FIONBIO, (char *)&off);
  1448.               } else if (errno != EINTR)
  1449.                   break;
  1450.  
  1451. --- 1251,1257 -----
  1452.                   break;
  1453.               if (errno == EWOULDBLOCK) {
  1454.                   int off = 0;
  1455. !                 
  1456.                   (void) ioctl(SHIN, FIONBIO, (char *)&off);
  1457.               } else if (errno != EINTR)
  1458.                   break;
  1459. ***************
  1460. *** 1244,1250
  1461.               } else if (errno != EINTR)
  1462.                   break;
  1463.           }
  1464. !         if (c <= 0)
  1465.               return (-1);
  1466.           feobp += c;
  1467.   #ifndef FILEC
  1468.  
  1469. --- 1256,1262 -----
  1470.               } else if (errno != EINTR)
  1471.                   break;
  1472.           }
  1473. !         if (c <= 0) {
  1474.               return (-1);
  1475.           }
  1476.           feobp += c;
  1477. ***************
  1478. *** 1246,1251
  1479.           }
  1480.           if (c <= 0)
  1481.               return (-1);
  1482.           feobp += c;
  1483.   #ifndef FILEC
  1484.           goto again;
  1485.  
  1486. --- 1258,1264 -----
  1487.           }
  1488.           if (c <= 0) {
  1489.               return (-1);
  1490. +         }
  1491.           feobp += c;
  1492.           if (!intty)
  1493.               goto again;
  1494. ***************
  1495. *** 1247,1256
  1496.           if (c <= 0)
  1497.               return (-1);
  1498.           feobp += c;
  1499. ! #ifndef FILEC
  1500. !         goto again;
  1501. ! #else
  1502. !         if (filec && !intty)
  1503.               goto again;
  1504.   #endif
  1505.       }
  1506.  
  1507. --- 1260,1266 -----
  1508.               return (-1);
  1509.           }
  1510.           feobp += c;
  1511. !         if (!intty)
  1512.               goto again;
  1513.       }
  1514.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1515. ***************
  1516. *** 1252,1258
  1517.   #else
  1518.           if (filec && !intty)
  1519.               goto again;
  1520. - #endif
  1521.       }
  1522.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1523.       fseekp++;
  1524.  
  1525. --- 1262,1267 -----
  1526.           feobp += c;
  1527.           if (!intty)
  1528.               goto again;
  1529.       }
  1530.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1531.       fseekp++;
  1532. *** sh.local.h    Thu Jun  6 13:15:34 1985
  1533. --- /usr/src/local/tcsh/sh.local.h    Mon Aug 17 21:32:31 1987
  1534. ***************
  1535. *** 22,28
  1536.    */
  1537.   
  1538.   #define    BUFSIZ    1024        /* default buffer size */
  1539. ! #define    SHELLPATH    "/bin/csh"
  1540.   #define    OTHERSH        "/bin/sh"
  1541.   #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1542.   #define    MAILINTVL    600    /* 10 minutes */
  1543.  
  1544. --- 22,30 -----
  1545.    */
  1546.   
  1547.   #define    BUFSIZ    1024        /* default buffer size */
  1548. ! #ifndef SHELLPATH
  1549. ! #define    SHELLPATH    "/bin/tcsh"
  1550. ! #endif
  1551.   #define    OTHERSH        "/bin/sh"
  1552.   #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1553.   #define    MAILINTVL    600    /* 10 minutes */
  1554. *** sh.misc.c    Sat Mar 29 07:37:28 1986
  1555. --- /usr/src/local/tcsh/sh.misc.c    Mon Aug 17 21:32:32 1987
  1556. ***************
  1557. *** 88,94
  1558.   #else
  1559.       showall(av);
  1560.       printf("i=%d: Out of memory\n", i);
  1561. !     chdir("/usr/bill/cshcore");
  1562.       abort();
  1563.   #endif
  1564.       return 0;        /* fool lint */
  1565.  
  1566. --- 88,94 -----
  1567.   #else
  1568.       showall(av);
  1569.       printf("i=%d: Out of memory\n", i);
  1570. !     /* chdir("/usr/bill/cshcore"); */
  1571.       abort();
  1572.   #endif
  1573.       return 0;        /* fool lint */
  1574. *** sh.print.c    Thu Jun  6 13:15:28 1985
  1575. --- /usr/src/local/tcsh/sh.print.c    Mon Aug 17 21:44:36 1987
  1576. ***************
  1577. *** 42,48
  1578.       printf("%d%d", i / 10, i % 10);
  1579.   }
  1580.   
  1581. ! char    linbuf[128];
  1582.   char    *linp = linbuf;
  1583.   
  1584.   putchar(c)
  1585.  
  1586. --- 42,48 -----
  1587.       printf("%d%d", i / 10, i % 10);
  1588.   }
  1589.   
  1590. ! char    linbuf[2048];        /* was 128 */
  1591.   char    *linp = linbuf;
  1592.   int lbuffed = 1;        /* true if line buffered */
  1593.   
  1594. ***************
  1595. *** 44,49
  1596.   
  1597.   char    linbuf[128];
  1598.   char    *linp = linbuf;
  1599.   
  1600.   putchar(c)
  1601.       register int c;
  1602.  
  1603. --- 44,50 -----
  1604.   
  1605.   char    linbuf[2048];        /* was 128 */
  1606.   char    *linp = linbuf;
  1607. + int lbuffed = 1;        /* true if line buffered */
  1608.   
  1609.   putchar(c)
  1610.       register int c;
  1611. ***************
  1612. *** 49,55
  1613.       register int c;
  1614.   {
  1615.   
  1616. !     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n')) {
  1617.           putchar('^');
  1618.           if (c == 0177)
  1619.               c = '?';
  1620.  
  1621. --- 50,56 -----
  1622.       register int c;
  1623.   {
  1624.   
  1625. !     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n' && c != '\r')) {
  1626.           putchar('^');
  1627.           if (c == 0177)
  1628.               c = '?';
  1629. ***************
  1630. *** 58,64
  1631.       }
  1632.       c &= TRIM;
  1633.       *linp++ = c;
  1634. !     if (c == '\n' || linp >= &linbuf[sizeof linbuf - 2])
  1635.           flush();
  1636.   }
  1637.   
  1638.  
  1639. --- 59,65 -----
  1640.       }
  1641.       c &= TRIM;
  1642.       *linp++ = c;
  1643. !     if ((lbuffed && c == '\n') || linp >= &linbuf[sizeof linbuf - 2])
  1644.           flush();
  1645.   }
  1646.   
  1647. ***************
  1648. *** 62,67
  1649.           flush();
  1650.   }
  1651.   
  1652.   draino()
  1653.   {
  1654.   
  1655.  
  1656. --- 63,77 -----
  1657.           flush();
  1658.   }
  1659.   
  1660. + putraw(c)
  1661. +     register int c;
  1662. + {
  1663. +     c &= TRIM;
  1664. +     *linp++ = c;
  1665. +     if (linp >= &linbuf[sizeof linbuf - 2])
  1666. +         flush();
  1667. + }
  1668.   draino()
  1669.   {
  1670.   
  1671. ***************
  1672. *** 87,92
  1673.           (void) write(unit, "\n", 1);
  1674.       }
  1675.   #endif
  1676. !     (void) write(unit, linbuf, linp - linbuf);
  1677.       linp = linbuf;
  1678.   }
  1679.  
  1680. --- 97,102 -----
  1681.           (void) write(unit, "\n", 1);
  1682.       }
  1683.   #endif
  1684. !     (void) write(unit, linbuf, (int) (linp - linbuf));
  1685.       linp = linbuf;
  1686.   }
  1687. *** sh.proc.c    Tue May 13 01:12:46 1986
  1688. --- /usr/src/local/tcsh/sh.proc.c    Mon Aug 17 21:32:39 1987
  1689. ***************
  1690. *** 34,39
  1691.       register int pid;
  1692.       union wait w;
  1693.       int jobflags;
  1694.       struct rusage ru;
  1695.   
  1696.   loop:
  1697.  
  1698. --- 34,40 -----
  1699.       register int pid;
  1700.       union wait w;
  1701.       int jobflags;
  1702. + #ifndef OREO
  1703.       struct rusage ru;
  1704.   #endif
  1705.   
  1706. ***************
  1707. *** 35,40
  1708.       union wait w;
  1709.       int jobflags;
  1710.       struct rusage ru;
  1711.   
  1712.   loop:
  1713.       pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG), &ru);
  1714.  
  1715. --- 36,42 -----
  1716.       int jobflags;
  1717.   #ifndef OREO
  1718.       struct rusage ru;
  1719. + #endif
  1720.   
  1721.   loop:
  1722.       pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1723. ***************
  1724. *** 37,43
  1725.       struct rusage ru;
  1726.   
  1727.   loop:
  1728. !     pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG), &ru);
  1729.       if (pid <= 0) {
  1730.           if (errno == EINTR) {
  1731.               errno = 0;
  1732.  
  1733. --- 39,50 -----
  1734.   #endif
  1735.   
  1736.   loop:
  1737. !     pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1738. ! #ifdef    OREO
  1739. !             0);
  1740. ! #else    OREO
  1741. !             &ru);
  1742. ! #endif    OREO
  1743.       if (pid <= 0) {
  1744.           if (errno == EINTR) {
  1745.               errno = 0;
  1746. ***************
  1747. *** 60,65
  1748.       } else {
  1749.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1750.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1751.           pp->p_rusage = ru;
  1752.           if (WIFSIGNALED(w)) {
  1753.               if (w.w_termsig == SIGINT)
  1754.  
  1755. --- 67,73 -----
  1756.       } else {
  1757.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1758.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1759. + #ifndef    OREO
  1760.           pp->p_rusage = ru;
  1761.   #endif OREO
  1762.           if (WIFSIGNALED(w)) {
  1763. ***************
  1764. *** 61,66
  1765.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1766.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1767.           pp->p_rusage = ru;
  1768.           if (WIFSIGNALED(w)) {
  1769.               if (w.w_termsig == SIGINT)
  1770.                   pp->p_flags |= PINTERRUPTED;
  1771.  
  1772. --- 69,75 -----
  1773.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1774.   #ifndef    OREO
  1775.           pp->p_rusage = ru;
  1776. + #endif OREO
  1777.           if (WIFSIGNALED(w)) {
  1778.               if (w.w_termsig == SIGINT)
  1779.                   pp->p_flags |= PINTERRUPTED;
  1780. ***************
  1781. *** 211,216
  1782.           sigpause(sigblock(0) &~ sigmask(SIGCHLD));
  1783.       }
  1784.       (void) sigsetmask(omask);
  1785.       if (tpgrp > 0)            /* get tty back */
  1786.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1787.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1788.  
  1789. --- 220,226 -----
  1790.           sigpause(sigblock(0) &~ sigmask(SIGCHLD));
  1791.       }
  1792.       (void) sigsetmask(omask);
  1793. + #ifdef    BSDJOBS
  1794.       if (tpgrp > 0)            /* get tty back */
  1795.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1796.   #endif    BSDJOBS
  1797. ***************
  1798. *** 213,218
  1799.       (void) sigsetmask(omask);
  1800.       if (tpgrp > 0)            /* get tty back */
  1801.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1802.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1803.            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1804.           if (jobflags&PSTOPPED)
  1805.  
  1806. --- 223,229 -----
  1807.   #ifdef    BSDJOBS
  1808.       if (tpgrp > 0)            /* get tty back */
  1809.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1810. + #endif    BSDJOBS
  1811.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1812.            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1813.           if (jobflags&PSTOPPED)
  1814. ***************
  1815. *** 628,633
  1816.           if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1817.               if (linp != linbuf)
  1818.                   printf("\n\t");
  1819.               { static struct rusage zru;
  1820.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1821.                   &pp->p_btime);
  1822.  
  1823. --- 639,645 -----
  1824.           if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1825.               if (linp != linbuf)
  1826.                   printf("\n\t");
  1827. + #ifndef OREO
  1828.               { static struct rusage zru;
  1829.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1830.                   &pp->p_btime);
  1831. ***************
  1832. *** 632,637
  1833.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1834.                   &pp->p_btime);
  1835.               }
  1836.           }
  1837.           if (tp == pp->p_friends) {
  1838.               if (linp != linbuf)
  1839.  
  1840. --- 644,650 -----
  1841.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1842.                   &pp->p_btime);
  1843.               }
  1844. + #endif OREO
  1845.           }
  1846.           if (tp == pp->p_friends) {
  1847.               if (linp != linbuf)
  1848. ***************
  1849. *** 654,659
  1850.   ptprint(tp)
  1851.       register struct process *tp;
  1852.   {
  1853.       struct timeval tetime, diff;
  1854.       static struct timeval ztime;
  1855.       struct rusage ru;
  1856.  
  1857. --- 667,675 -----
  1858.   ptprint(tp)
  1859.       register struct process *tp;
  1860.   {
  1861. + #ifdef OREO
  1862. +     printf ("There is no time stuff for OREO yet (sorry).\n");
  1863. + #else OREO
  1864.       struct timeval tetime, diff;
  1865.       static struct timeval ztime;
  1866.       struct rusage ru;
  1867. ***************
  1868. *** 669,674
  1869.               tetime = diff;
  1870.       } while ((pp = pp->p_friends) != tp);
  1871.       prusage(&zru, &ru, &tetime, &ztime);
  1872.   }
  1873.   
  1874.   /*
  1875.  
  1876. --- 685,691 -----
  1877.               tetime = diff;
  1878.       } while ((pp = pp->p_friends) != tp);
  1879.       prusage(&zru, &ru, &tetime, &ztime);
  1880. + #endif OREO
  1881.   }
  1882.   
  1883.   /*
  1884. ***************
  1885. *** 896,901
  1886.       if (!foregnd)
  1887.           pclrcurr(pp);
  1888.       (void) pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1889.       if (foregnd)
  1890.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1891.       if (jobflags&PSTOPPED)
  1892.  
  1893. --- 913,919 -----
  1894.       if (!foregnd)
  1895.           pclrcurr(pp);
  1896.       (void) pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1897. + #ifdef    BSDJOBS
  1898.       if (foregnd)
  1899.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1900.       if (jobflags&PSTOPPED)
  1901. ***************
  1902. *** 900,905
  1903.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1904.       if (jobflags&PSTOPPED)
  1905.           (void) killpg(pp->p_jobid, SIGCONT);
  1906.       (void) sigsetmask(omask);
  1907.   }
  1908.   
  1909.  
  1910. --- 918,924 -----
  1911.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1912.       if (jobflags&PSTOPPED)
  1913.           (void) killpg(pp->p_jobid, SIGCONT);
  1914. + #endif    BSDJOBS
  1915.       (void) sigsetmask(omask);
  1916.   }
  1917.   
  1918. ***************
  1919. *** 1063,1068
  1920.               (void) signal(SIGINT, SIG_IGN);
  1921.               (void) signal(SIGQUIT, SIG_IGN);
  1922.           }
  1923.           if (wanttty > 0)
  1924.               (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pgrp);
  1925.           if (wanttty >= 0 && tpgrp >= 0)
  1926.  
  1927. --- 1082,1088 -----
  1928.               (void) signal(SIGINT, SIG_IGN);
  1929.               (void) signal(SIGQUIT, SIG_IGN);
  1930.           }
  1931. + #ifdef BSDJOBS
  1932.           if (wanttty > 0)
  1933.               (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pgrp);
  1934.           if (wanttty >= 0 && tpgrp >= 0)
  1935. ***************
  1936. *** 1069,1074
  1937.               (void) setpgrp(0, pgrp);
  1938.           if (tpgrp > 0)
  1939.               tpgrp = 0;        /* gave tty away */
  1940.           /*
  1941.            * Nohup and nice apply only to TCOM's but it would be
  1942.            * nice (?!?) if you could say "nohup (foo;bar)"
  1943.  
  1944. --- 1089,1095 -----
  1945.               (void) setpgrp(0, pgrp);
  1946.           if (tpgrp > 0)
  1947.               tpgrp = 0;        /* gave tty away */
  1948. + #endif BSDJOBS
  1949.           /*
  1950.            * Nohup and nice apply only to TCOM's but it would be
  1951.            * nice (?!?) if you could say "nohup (foo;bar)"
  1952. *** sh.proc.h    Thu Jun  6 13:15:49 1985
  1953. --- /usr/src/local/tcsh/sh.proc.h    Mon Aug 17 21:32:40 1987
  1954. ***************
  1955. *** 30,35
  1956.       /* if a job is stopped/background p_jobid gives its pgrp */
  1957.       struct    timeval p_btime;    /* begin time */
  1958.       struct    timeval p_etime;    /* end time */
  1959.       struct    rusage p_rusage;
  1960.       char    *p_command;        /* first PMAXLEN chars of command */
  1961.   };
  1962.  
  1963. --- 30,36 -----
  1964.       /* if a job is stopped/background p_jobid gives its pgrp */
  1965.       struct    timeval p_btime;    /* begin time */
  1966.       struct    timeval p_etime;    /* end time */
  1967. + #ifndef OREO
  1968.       struct    rusage p_rusage;
  1969.   #endif    OREO
  1970.       char    *p_command;        /* first PMAXLEN chars of command */
  1971. ***************
  1972. *** 31,36
  1973.       struct    timeval p_btime;    /* begin time */
  1974.       struct    timeval p_etime;    /* end time */
  1975.       struct    rusage p_rusage;
  1976.       char    *p_command;        /* first PMAXLEN chars of command */
  1977.   };
  1978.   
  1979.  
  1980. --- 32,38 -----
  1981.       struct    timeval p_etime;    /* end time */
  1982.   #ifndef OREO
  1983.       struct    rusage p_rusage;
  1984. + #endif    OREO
  1985.       char    *p_command;        /* first PMAXLEN chars of command */
  1986.   };
  1987.   
  1988. *** sh.sem.c    Tue May 13 01:08:43 1986
  1989. --- /usr/src/local/tcsh/sh.sem.c    Thu Sep 24 15:04:35 1987
  1990. ***************
  1991. *** 187,192
  1992.                       (void) signal(SIGINT, SIG_IGN);
  1993.                       (void) signal(SIGQUIT, SIG_IGN);
  1994.                   }
  1995.                   if (wanttty > 0)
  1996.                       (void) ioctl(FSHTTY, TIOCSPGRP,
  1997.                           (char *)&pgrp);
  1998.  
  1999. --- 187,193 -----
  2000.                       (void) signal(SIGINT, SIG_IGN);
  2001.                       (void) signal(SIGQUIT, SIG_IGN);
  2002.                   }
  2003. + #ifdef BSDJOBS
  2004.                   if (wanttty > 0)
  2005.                       (void) ioctl(FSHTTY, TIOCSPGRP,
  2006.                           (char *)&pgrp);
  2007. ***************
  2008. *** 192,197
  2009.                           (char *)&pgrp);
  2010.                   if (wanttty >= 0 && tpgrp >= 0)
  2011.                       (void) setpgrp(0, pgrp);
  2012.                   if (tpgrp > 0)
  2013.                       tpgrp = 0;
  2014.                   if (t->t_dflg & FNOHUP)
  2015.  
  2016. --- 193,199 -----
  2017.                           (char *)&pgrp);
  2018.                   if (wanttty >= 0 && tpgrp >= 0)
  2019.                       (void) setpgrp(0, pgrp);
  2020. + #endif    BSDJOBS
  2021.                   if (tpgrp > 0)
  2022.                       tpgrp = 0;
  2023.                   if (t->t_dflg & FNOHUP)
  2024. *** sh.set.c    Thu Jun  6 13:15:54 1985
  2025. --- /usr/src/local/tcsh/sh.set.c    Thu Sep 24 15:03:28 1987
  2026. ***************
  2027. *** 81,87
  2028.   
  2029.               HIST = *p++;
  2030.               HISTSUB = *p;
  2031. !         } else if (eq(vp, "user"))
  2032.               setenv("USER", value(vp));
  2033.           else if (eq(vp, "term"))
  2034.               setenv("TERM", value(vp));
  2035.  
  2036. --- 81,87 -----
  2037.   
  2038.               HIST = *p++;
  2039.               HISTSUB = *p;
  2040. !         } else if (eq(vp, "user")) {
  2041.               setenv("USER", value(vp));
  2042.           } else if (eq(vp, "term")) {
  2043.               setenv("TERM", value(vp));
  2044. ***************
  2045. *** 83,89
  2046.               HISTSUB = *p;
  2047.           } else if (eq(vp, "user"))
  2048.               setenv("USER", value(vp));
  2049. !         else if (eq(vp, "term"))
  2050.               setenv("TERM", value(vp));
  2051.           else if (eq(vp, "home"))
  2052.               setenv("HOME", value(vp));
  2053.  
  2054. --- 83,89 -----
  2055.               HISTSUB = *p;
  2056.           } else if (eq(vp, "user")) {
  2057.               setenv("USER", value(vp));
  2058. !         } else if (eq(vp, "term")) {
  2059.               setenv("TERM", value(vp));
  2060.               ed_Init(); /* reset the editor */
  2061.           } else if (eq(vp, "home")) {
  2062. ***************
  2063. *** 85,91
  2064.               setenv("USER", value(vp));
  2065.           else if (eq(vp, "term"))
  2066.               setenv("TERM", value(vp));
  2067. !         else if (eq(vp, "home"))
  2068.               setenv("HOME", value(vp));
  2069.   #ifdef FILEC
  2070.           else if (eq(vp, "filec"))
  2071.  
  2072. --- 85,92 -----
  2073.               setenv("USER", value(vp));
  2074.           } else if (eq(vp, "term")) {
  2075.               setenv("TERM", value(vp));
  2076. !             ed_Init(); /* reset the editor */
  2077. !         } else if (eq(vp, "home")) {
  2078.               setenv("HOME", value(vp));
  2079.           }
  2080.       } while (p = *v++);
  2081. ***************
  2082. *** 87,96
  2083.               setenv("TERM", value(vp));
  2084.           else if (eq(vp, "home"))
  2085.               setenv("HOME", value(vp));
  2086. ! #ifdef FILEC
  2087. !         else if (eq(vp, "filec"))
  2088. !             filec = 1;
  2089. ! #endif
  2090.       } while (p = *v++);
  2091.   }
  2092.   
  2093.  
  2094. --- 88,94 -----
  2095.               ed_Init(); /* reset the editor */
  2096.           } else if (eq(vp, "home")) {
  2097.               setenv("HOME", value(vp));
  2098. !         }
  2099.       } while (p = *v++);
  2100.   }
  2101.   
  2102. ***************
  2103. *** 435,444
  2104.           HIST = '!';
  2105.           HISTSUB = '^';
  2106.       }
  2107. - #ifdef FILEC
  2108. -     if (adrof("filec") == 0)
  2109. -         filec = 0;
  2110. - #endif
  2111.   }
  2112.   
  2113.   unset1(v, head)
  2114.  
  2115. --- 433,438 -----
  2116.           HIST = '!';
  2117.           HISTSUB = '^';
  2118.       }
  2119.   }
  2120.   
  2121.   unset1(v, head)
  2122. *** sh.time.c    Tue May 13 01:07:31 1986
  2123. --- /usr/src/local/tcsh/sh.time.c    Mon Aug 17 21:32:45 1987
  2124. ***************
  2125. *** 16,21
  2126.   
  2127.   settimes()
  2128.   {
  2129.       struct rusage ruch;
  2130.   
  2131.       (void) gettimeofday(&time0, (struct timezone *)0);
  2132.  
  2133. --- 16,22 -----
  2134.   
  2135.   settimes()
  2136.   {
  2137. + #ifndef OREO
  2138.       struct rusage ruch;
  2139.   #endif
  2140.   
  2141. ***************
  2142. *** 17,22
  2143.   settimes()
  2144.   {
  2145.       struct rusage ruch;
  2146.   
  2147.       (void) gettimeofday(&time0, (struct timezone *)0);
  2148.       (void) getrusage(RUSAGE_SELF, &ru0);
  2149.  
  2150. --- 18,24 -----
  2151.   {
  2152.   #ifndef OREO
  2153.       struct rusage ruch;
  2154. + #endif
  2155.   
  2156.       (void) gettimeofday(&time0, (struct timezone *)0);
  2157.   #ifndef    OREO
  2158. ***************
  2159. *** 19,24
  2160.       struct rusage ruch;
  2161.   
  2162.       (void) gettimeofday(&time0, (struct timezone *)0);
  2163.       (void) getrusage(RUSAGE_SELF, &ru0);
  2164.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2165.       ruadd(&ru0, &ruch);
  2166.  
  2167. --- 21,27 -----
  2168.   #endif
  2169.   
  2170.       (void) gettimeofday(&time0, (struct timezone *)0);
  2171. + #ifndef    OREO
  2172.       (void) getrusage(RUSAGE_SELF, &ru0);
  2173.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2174.       ruadd(&ru0, &ruch);
  2175. ***************
  2176. *** 22,27
  2177.       (void) getrusage(RUSAGE_SELF, &ru0);
  2178.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2179.       ruadd(&ru0, &ruch);
  2180.   }
  2181.   
  2182.   /*
  2183.  
  2184. --- 25,31 -----
  2185.       (void) getrusage(RUSAGE_SELF, &ru0);
  2186.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2187.       ruadd(&ru0, &ruch);
  2188. + #endif OREO
  2189.   }
  2190.   
  2191.   /*
  2192. ***************
  2193. *** 30,35
  2194.    */
  2195.   dotime()
  2196.   {
  2197.       struct timeval timedol;
  2198.       struct rusage ru1, ruch;
  2199.   
  2200.  
  2201. --- 34,40 -----
  2202.    */
  2203.   dotime()
  2204.   {
  2205. + #ifndef OREO
  2206.       struct timeval timedol;
  2207.       struct rusage ru1, ruch;
  2208.   
  2209. ***************
  2210. *** 38,43
  2211.       ruadd(&ru1, &ruch);
  2212.       (void) gettimeofday(&timedol, (struct timezone *)0);
  2213.       prusage(&ru0, &ru1, &timedol, &time0);
  2214.   }
  2215.   
  2216.   /*
  2217.  
  2218. --- 43,49 -----
  2219.       ruadd(&ru1, &ruch);
  2220.       (void) gettimeofday(&timedol, (struct timezone *)0);
  2221.       prusage(&ru0, &ru1, &timedol, &time0);
  2222. + #endif
  2223.   }
  2224.   
  2225.   /*
  2226. ***************
  2227. *** 57,62
  2228.       (void) setpriority(PRIO_PROCESS, 0, nval);
  2229.   }
  2230.   
  2231.   ruadd(ru, ru2)
  2232.       register struct rusage *ru, *ru2;
  2233.   {
  2234.  
  2235. --- 63,69 -----
  2236.       (void) setpriority(PRIO_PROCESS, 0, nval);
  2237.   }
  2238.   
  2239. + #ifndef OREO
  2240.   ruadd(ru, ru2)
  2241.       register struct rusage *ru, *ru2;
  2242.   {
  2243. ***************
  2244. *** 155,160
  2245.       }
  2246.       putchar('\n');
  2247.   }
  2248.   
  2249.   pdeltat(t1, t0)
  2250.       struct timeval *t1, *t0;
  2251.  
  2252. --- 162,168 -----
  2253.       }
  2254.       putchar('\n');
  2255.   }
  2256. + #endif
  2257.   
  2258.   pdeltat(t1, t0)
  2259.       struct timeval *t1, *t0;
  2260. *** Makefile    Thu Sep 24 15:24:33 1987
  2261. --- /usr/src/local/tcsh/Makefile    Mon Aug 17 21:53:45 1987
  2262. ***************
  2263. *** 37,43
  2264.   
  2265.   # on some machines, the alloc.c works.  On others, it dosn't.  Besides, 
  2266.   # nmalloc is much faster...
  2267. ! ALLOC=nmalloc.o
  2268.   
  2269.   SHOBJS=    sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o \
  2270.       sh.exp.o sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o \
  2271.  
  2272. --- 37,43 -----
  2273.   
  2274.   # on some machines, the alloc.c works.  On others, it dosn't.  Besides, 
  2275.   # nmalloc is much faster...
  2276. ! ALLOC=alloc.o
  2277.   
  2278.   SHOBJS=    sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
  2279.       sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
  2280. ***************
  2281. *** 39,47
  2282.   # nmalloc is much faster...
  2283.   ALLOC=nmalloc.o
  2284.   
  2285. ! SHOBJS=    sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o \
  2286. !     sh.exp.o sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o \
  2287. !     sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o sh.sig.o sh.time.o
  2288.   
  2289.   TWOBJS=    tw.help.o tw.init.o tw.parse.o tw.spell.o
  2290.   
  2291.  
  2292. --- 39,48 -----
  2293.   # nmalloc is much faster...
  2294.   ALLOC=alloc.o
  2295.   
  2296. ! SHOBJS=    sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
  2297. !     sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
  2298. !     sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o \
  2299. !     sh.time.o
  2300.   
  2301.   TWOBJS=    tw.help.o tw.init.o tw.parse.o tw.spell.o
  2302.   
  2303. ***************
  2304. *** 61,67
  2305.       rm -f tcsh.ps
  2306.       -ptroff -man tcsh.1 > tcsh.ps
  2307.   
  2308. ! ${SHOBJS}: sh.h sh.local.h
  2309.   
  2310.   ${TWOBJS}: sh.h sh.local.h tw.h
  2311.   
  2312.  
  2313. --- 62,68 -----
  2314.       rm -f tcsh.ps
  2315.       -ptroff -man tcsh.1 > tcsh.ps
  2316.   
  2317. ! # ${SHOBJS}: sh.h sh.local.h
  2318.   
  2319.   ${TWOBJS}: sh.h sh.local.h tw.h
  2320.   
  2321. ***************
  2322. *** 124,126
  2323.   
  2324.   tags:    /tmp
  2325.       ${CTAGS} sh*.c
  2326.  
  2327. --- 125,148 -----
  2328.   
  2329.   tags:    /tmp
  2330.       ${CTAGS} sh*.c
  2331. + sh.o: sh.h sh.local.h sh.char.h
  2332. + sh.char.o: sh.char.h
  2333. + sh.dir.o: sh.h sh.local.h sh.dir.h
  2334. + sh.dol.o: sh.h sh.local.h sh.char.h
  2335. + sh.err.o: sh.h sh.local.h sh.char.h
  2336. + sh.exec.o: sh.h sh.local.h sh.char.h
  2337. + sh.exp.o: sh.h sh.local.h sh.char.h
  2338. + sh.file.o: sh.h sh.local.h sh.char.h
  2339. + sh.func.o: sh.h sh.local.h sh.char.h
  2340. + sh.glob.o: sh.h sh.local.h sh.char.h
  2341. + sh.hist.o: sh.h sh.local.h sh.char.h
  2342. + sh.init.o: sh.local.h
  2343. + sh.lex.o: sh.h sh.local.h sh.char.h
  2344. + sh.misc.o: sh.h sh.local.h sh.char.h
  2345. + sh.parse.o: sh.h sh.local.h sh.char.h
  2346. + sh.print.o: sh.h sh.local.h sh.char.h
  2347. + sh.proc.o: sh.h sh.local.h sh.dir.h sh.proc.h sh.char.h
  2348. + sh.sem.o: sh.h sh.local.h sh.proc.h sh.char.h
  2349. + sh.set.o: sh.h sh.local.h sh.char.h
  2350. + sh.time.o: sh.h sh.local.h sh.char.h
  2351. *** ed.init.c    Thu Sep 24 15:24:43 1987
  2352. --- /usr/src/local/tcsh/ed.init.c    Mon Aug 31 09:26:09 1987
  2353. ***************
  2354. *** 86,92
  2355.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2356.   
  2357.   #  ifdef SIGWINCH
  2358. !     sigset(SIGWINCH, window_change); /* for window systems */
  2359.   #  endif
  2360.   # endif OREO
  2361.   #else SVID
  2362.  
  2363. --- 86,92 -----
  2364.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2365.   
  2366.   #  ifdef SIGWINCH
  2367. !     signal(SIGWINCH, window_change); /* for window systems */
  2368.   #  endif
  2369.   # endif OREO
  2370.   #else SVID
  2371. ***************
  2372. *** 135,141
  2373.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2374.   
  2375.   # ifdef SIGWINCH
  2376. !     sigset(SIGWINCH, window_change); /* for window systems */
  2377.   # endif
  2378.   #endif SVID
  2379.       }
  2380.  
  2381. --- 135,141 -----
  2382.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2383.   
  2384.   # ifdef SIGWINCH
  2385. !     signal(SIGWINCH, window_change); /* for window systems */
  2386.   # endif
  2387.   #endif SVID
  2388.       }
  2389. ***************
  2390. *** 190,196
  2391.       }
  2392.   
  2393.       xb.sg_erase = '\177';    /* del prev. char == DEL */
  2394. !     xb.sg_kill = CTRL(w);    /* special case of del region */
  2395.   
  2396.       xtc.t_intrc = CTRL(c);    /* SIGINTR */
  2397.       xtc.t_quitc = CTRL(\\);    /* SIGQUIT */
  2398.  
  2399. --- 190,196 -----
  2400.       }
  2401.   
  2402.       xb.sg_erase = '\177';    /* del prev. char == DEL */
  2403. !     xb.sg_kill = CTRL(u);    /* special case of del region */
  2404.   
  2405.       xtc.t_intrc = CTRL(c);    /* SIGINTR */
  2406.       xtc.t_quitc = CTRL(\\);    /* SIGQUIT */
  2407. *** ed.inputl.c    Thu Sep 24 15:24:45 1987
  2408. --- /usr/src/local/tcsh/ed.inputl.c    Thu Sep 17 23:24:16 1987
  2409. ***************
  2410. *** 212,218
  2411.   
  2412.       hp = Histlist.Hnext;
  2413.       if (hp == (struct Hist *)0) {
  2414. !     printf ("no hp\n");
  2415.       Beep();
  2416.       return;
  2417.       }
  2418.  
  2419. --- 212,218 -----
  2420.   
  2421.       hp = Histlist.Hnext;
  2422.       if (hp == (struct Hist *)0) {
  2423. !     printf ("No history pointer, probably no history\n");
  2424.       Beep();
  2425.       return;
  2426.       }
  2427. *** ed.screen.c    Thu Sep 24 15:25:04 1987
  2428. --- /usr/src/local/tcsh/ed.screen.c    Mon Aug 17 23:51:23 1987
  2429. ***************
  2430. *** 55,61
  2431.   
  2432.       if (where > TermV) {
  2433.   #ifdef DEBUG_SCREEN
  2434. !     printf ("MoveToLine: where is riduculous: %d\r\n", where);
  2435.       flush();
  2436.   #endif
  2437.       return;
  2438.  
  2439. --- 55,61 -----
  2440.   
  2441.       if (where > TermV) {
  2442.   #ifdef DEBUG_SCREEN
  2443. !     printf ("MoveToLine: where is ridiculous: %d\r\n", where);
  2444.       flush();
  2445.   #endif
  2446.       return;
  2447. ***************
  2448. *** 240,245
  2449.       char *area = buffer;
  2450.       char *MyTerm;
  2451.       char *getenv();
  2452.   
  2453.   #ifdef SIGWINCH
  2454.       sighold(SIGWINCH);        /* don't want to confuse things here */
  2455.  
  2456. --- 240,246 -----
  2457.       char *area = buffer;
  2458.       char *MyTerm;
  2459.       char *getenv();
  2460. +     int    omask;
  2461.   
  2462.   #ifdef SIGWINCH
  2463.       omask = sighold(SIGWINCH);        /* don't want to confuse things here */
  2464. ***************
  2465. *** 242,248
  2466.       char *getenv();
  2467.   
  2468.   #ifdef SIGWINCH
  2469. !     sighold(SIGWINCH);        /* don't want to confuse things here */
  2470.   #endif
  2471.   
  2472.       MyTerm = getenv("TERM");
  2473.  
  2474. --- 243,249 -----
  2475.       int    omask;
  2476.   
  2477.   #ifdef SIGWINCH
  2478. !     omask = sighold(SIGWINCH);        /* don't want to confuse things here */
  2479.   #endif
  2480.   
  2481.       MyTerm = getenv("TERM");
  2482. ***************
  2483. *** 355,361
  2484.       ClearDisp();
  2485.   
  2486.   #ifdef SIGWINCH
  2487. !     sigrelse(SIGWINCH);        /* can change it again */
  2488.   #endif
  2489.   }
  2490.   
  2491.  
  2492. --- 356,362 -----
  2493.       ClearDisp();
  2494.   
  2495.   #ifdef SIGWINCH
  2496. !     sigsetmask(omask);
  2497.   #endif
  2498.   }
  2499.   
  2500. ***************
  2501. *** 396,401
  2502.       ClearDisp();
  2503.   
  2504.   #ifdef SIGWINCH
  2505. !     sigrelse(SIGWINCH);        /* can change it again */
  2506.   #endif
  2507.   }
  2508.  
  2509. --- 397,403 -----
  2510.       ClearDisp();
  2511.   
  2512.   #ifdef SIGWINCH
  2513. !     (void) sigsetmask(sigblock(0) & ~sigmask(SIGWINCH));
  2514.   #endif
  2515.   }
  2516.   
  2517. ***************
  2518. *** 399,401
  2519.       sigrelse(SIGWINCH);        /* can change it again */
  2520.   #endif
  2521.   }
  2522.  
  2523. --- 400,409 -----
  2524.       (void) sigsetmask(sigblock(0) & ~sigmask(SIGWINCH));
  2525.   #endif
  2526.   }
  2527. *** pwprintf.c    Thu Sep 24 15:25:07 1987
  2528. --- /usr/src/local/tcsh/pwprintf.c    Mon Aug 17 22:24:47 1987
  2529. ***************
  2530. *** 1,7
  2531.   /* A public-domain, minimal printf routine that prints through the putchar()
  2532.      routine.  Feel free to use for anything...  -- 7/17/87 Paul Placeway */
  2533.   
  2534. ! #include <ctype.h>
  2535.   #include <varargs.h>
  2536.   
  2537.   /* use varargs since it's the RIGHT WAY, and assuming things about parameters
  2538.  
  2539. --- 1,9 -----
  2540.   /* A public-domain, minimal printf routine that prints through the putchar()
  2541.      routine.  Feel free to use for anything...  -- 7/17/87 Paul Placeway */
  2542.   
  2543. ! #include "sh.h"
  2544. ! /*#include <ctype.h>*/
  2545. ! #include "sh.char.h"
  2546.   #include <varargs.h>
  2547.   
  2548.   /* use varargs since it's the RIGHT WAY, and assuming things about parameters
  2549. *** sh.nfunc.c    Thu Sep 24 15:24:30 1987
  2550. --- /usr/src/local/tcsh/sh.nfunc.c    Mon Aug 17 23:19:24 1987
  2551. ***************
  2552. *** 7,12
  2553.   #include "tw.h"
  2554.   
  2555.   #include <sys/ioctl.h>
  2556.   
  2557.   static int parsekey();
  2558.   static char *unparsekey();
  2559.  
  2560. --- 7,13 -----
  2561.   #include "tw.h"
  2562.   
  2563.   #include <sys/ioctl.h>
  2564. + #include "sh.char.h"
  2565.   
  2566.   static int parsekey();
  2567.   static char *unparsekey();
  2568. ***************
  2569. *** 11,16
  2570.   static int parsekey();
  2571.   static char *unparsekey();
  2572.   
  2573.   /*
  2574.    * Tops-C shell
  2575.    */
  2576.  
  2577. --- 12,19 -----
  2578.   static int parsekey();
  2579.   static char *unparsekey();
  2580.   
  2581. + extern    int    tglob(), trim();
  2582.   /*
  2583.    * Tops-C shell
  2584.    */
  2585. ***************
  2586. *** 344,350
  2587.       struct stat statb;
  2588.       
  2589.       if (setintr)
  2590. !     sigrelse(SIGINT);
  2591.   
  2592.       if (*++v == NULL) {
  2593.       t_search("", (char *)0, LIST, 0, 0);
  2594.  
  2595. --- 347,353 -----
  2596.       struct stat statb;
  2597.       
  2598.       if (setintr)
  2599. !         (void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
  2600.   
  2601.       if (*++v == NULL) {
  2602.       t_search("", (char *)0, LIST, 0, 0);
  2603. ***************
  2604. *** 356,362
  2605.       if (v == 0)
  2606.           bferr("No match");
  2607.       } else
  2608. !     scan(v, trim);
  2609.       k = 0;
  2610.       if (*(v+1))
  2611.       f = 1;
  2612.  
  2613. --- 359,368 -----
  2614.       if (v == 0)
  2615.           bferr("No match");
  2616.       } else
  2617. !         /*
  2618. !         scan(v, trim);
  2619. !         */
  2620. !         trim(v);
  2621.       k = 0;
  2622.       if (*(v+1))
  2623.       f = 1;
  2624. *** tw.h    Thu Sep 24 15:25:11 1987
  2625. --- /usr/src/local/tcsh/tw.h    Mon Aug 17 23:15:06 1987
  2626. ***************
  2627. *** 1,3
  2628.   #ifdef MAKE_TWENEX
  2629.   
  2630.   #define FREE_ITEMS(items,num)\
  2631.  
  2632. --- 1,4 -----
  2633.   #ifdef MAKE_TWENEX
  2634.   
  2635.   #define FREE_ITEMS(items,num)\
  2636. ***************
  2637. *** 2,8
  2638.   
  2639.   #define FREE_ITEMS(items,num)\
  2640.   {\
  2641. !     sighold (SIGINT);\
  2642.       free_items (items,num);\
  2643.       items = NULL;\
  2644.       sigrelse (SIGINT);\
  2645.  
  2646. --- 3,10 -----
  2647.   
  2648.   #define FREE_ITEMS(items,num)\
  2649.   {\
  2650. !     int    omask;\
  2651. !     omask = sighold (SIGINT);\
  2652.       free_items (items,num);\
  2653.       items = NULL;\
  2654.       sigsetmask(omask);\
  2655. ***************
  2656. *** 5,11
  2657.       sighold (SIGINT);\
  2658.       free_items (items,num);\
  2659.       items = NULL;\
  2660. !     sigrelse (SIGINT);\
  2661.   }
  2662.   
  2663.   #define FREE_DIR(fd)\
  2664.  
  2665. --- 7,13 -----
  2666.       omask = sighold (SIGINT);\
  2667.       free_items (items,num);\
  2668.       items = NULL;\
  2669. !     sigsetmask(omask);\
  2670.   }
  2671.   
  2672.   #define FREE_DIR(fd)\
  2673. ***************
  2674. *** 10,16
  2675.   
  2676.   #define FREE_DIR(fd)\
  2677.   {\
  2678. !     sighold (SIGINT);\
  2679.       closedir (fd);\
  2680.       fd = NULL;\
  2681.       sigrelse (SIGINT);\
  2682.  
  2683. --- 12,19 -----
  2684.   
  2685.   #define FREE_DIR(fd)\
  2686.   {\
  2687. !     int    omask;\
  2688. !     omask = sighold (SIGINT);\
  2689.       closedir (fd);\
  2690.       fd = NULL;\
  2691.       sigsetmask(omask);\
  2692. ***************
  2693. *** 13,19
  2694.       sighold (SIGINT);\
  2695.       closedir (fd);\
  2696.       fd = NULL;\
  2697. !     sigrelse (SIGINT);\
  2698.   }
  2699.   
  2700.   #define TRUE        1
  2701.  
  2702. --- 16,22 -----
  2703.       omask = sighold (SIGINT);\
  2704.       closedir (fd);\
  2705.       fd = NULL;\
  2706. !     sigsetmask(omask);\
  2707.   }
  2708.   
  2709.   #define TRUE        1
  2710. *** tw.help.c    Thu Sep 24 15:25:13 1987
  2711. --- /usr/src/local/tcsh/tw.help.c    Mon Aug 17 23:16:22 1987
  2712. ***************
  2713. *** 3,9
  2714.   #include "tw.h"
  2715.   #include "sh.h"
  2716.   
  2717.   /* actually look up and print documentation on a file.  Look down the path
  2718.      for an approiate file, then print it.  Note that the printing is NOT 
  2719.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2720.  
  2721. --- 3,8 -----
  2722.   #include "tw.h"
  2723.   #include "sh.h"
  2724.   
  2725.   /* actually look up and print documentation on a file.  Look down the path
  2726.      for an appropriate file, then print it.  Note that the printing is NOT 
  2727.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2728. ***************
  2729. *** 5,11
  2730.   
  2731.   
  2732.   /* actually look up and print documentation on a file.  Look down the path
  2733. !    for an approiate file, then print it.  Note that the printing is NOT 
  2734.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2735.      it only does so if there is no .help file to look in. */
  2736.   
  2737.  
  2738. --- 4,10 -----
  2739.   #include "sh.h"
  2740.   
  2741.   /* actually look up and print documentation on a file.  Look down the path
  2742. !    for an appropriate file, then print it.  Note that the printing is NOT 
  2743.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2744.      it only does so if there is no .help file to look in. */
  2745.   
  2746. *** tw.init.c    Thu Sep 24 15:25:15 1987
  2747. --- /usr/src/local/tcsh/tw.init.c    Thu Sep 24 15:45:32 1987
  2748. ***************
  2749. *** 120,125
  2750.       register char *cp;
  2751.       register struct biltins *bptr;
  2752.   
  2753.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2754.       tw_add_comm_name (cp);
  2755.       }
  2756.  
  2757. --- 120,127 -----
  2758.       register char *cp;
  2759.       register struct biltins *bptr;
  2760.   
  2761. +     for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) {
  2762. + #ifdef    OUTDEF
  2763.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2764.   #endif
  2765.       tw_add_comm_name (cp);
  2766. ***************
  2767. *** 121,126
  2768.       register struct biltins *bptr;
  2769.   
  2770.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2771.       tw_add_comm_name (cp);
  2772.       }
  2773.   }
  2774.  
  2775. --- 123,129 -----
  2776.       for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) {
  2777.   #ifdef    OUTDEF
  2778.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2779. + #endif
  2780.       tw_add_comm_name (cp);
  2781.       }
  2782.   }
  2783. ***************
  2784. *** 127,132
  2785.   
  2786.   tw_add_aliases ()
  2787.   {
  2788.       register struct varent *vp;
  2789.   
  2790.       vp = &aliases;
  2791.  
  2792. --- 130,161 -----
  2793.   
  2794.   tw_add_aliases ()
  2795.   {
  2796. +     register struct varent *p;
  2797. +     register struct varent *c;
  2798. +     p = &aliases;
  2799. +     for (;;) {
  2800. +         while (p->v_left)
  2801. +             p = p->v_left;
  2802. +     x:
  2803. +         if (p->v_parent == 0)        /* is it the header? */
  2804. +             return;
  2805. +         tw_add_comm_name(p->v_name);
  2806. +         if (p->v_right) {
  2807. +             p = p->v_right;
  2808. +             continue;
  2809. +         }
  2810. +         do {
  2811. +             c = p;
  2812. +             p = p->v_parent;
  2813. +         } while (p->v_right == c);
  2814. +         goto x;
  2815. +     }
  2816. + }
  2817. + #ifdef    OUTDEF
  2818. + tw_add_aliases ()
  2819. + {
  2820.       register struct varent *vp;
  2821.   
  2822.       vp = &aliases;
  2823. ***************
  2824. *** 136,138
  2825.       }
  2826.   
  2827.   }
  2828.  
  2829. --- 165,169 -----
  2830.       }
  2831.   
  2832.   }
  2833. + #endif
  2834. *** tw.parse.c    Thu Sep 24 15:25:19 1987
  2835. --- /usr/src/local/tcsh/tw.parse.c    Thu Sep 24 15:46:59 1987
  2836. ***************
  2837. *** 64,70
  2838.   /*  printf ("\ncmd_st:%s:\nword_start:%s:\n", cmd_st, word_start); */
  2839.                   /* for debugging */
  2840.       if (command == RECOGNIZE) {
  2841. !         search_ret = t_search (word, wp, command, space_left, is_a_cmd);
  2842.       if (InsertStr(wp) < 0)    /* put it in the input buffer */
  2843.           return 2;        /* error inserting */
  2844.       return search_ret;
  2845.  
  2846. --- 64,70 -----
  2847.   /*  printf ("\ncmd_st:%s:\nword_start:%s:\n", cmd_st, word_start); */
  2848.                   /* for debugging */
  2849.       if (command == RECOGNIZE) {
  2850. !     search_ret = t_search (word, wp, command, space_left, is_a_cmd);
  2851.       if (InsertStr(wp) < 0)    /* put it in the input buffer */
  2852.           return 2;        /* error inserting */
  2853.       return search_ret;
  2854. ***************
  2855. *** 200,206
  2856.       numitems = 0;
  2857.       if (dir_fd != NULL)
  2858.       FREE_DIR (dir_fd);
  2859.       looking_for_lognames = (*word == '~') && (index (word, '/') == NULL);
  2860.       looking_for_command &= (*word != '~') && (index (word, '/') == NULL);
  2861.   
  2862.  
  2863. --- 200,205 -----
  2864.       numitems = 0;
  2865.       if (dir_fd != NULL)
  2866.       FREE_DIR (dir_fd);
  2867.       looking_for_lognames = (*word == '~') && (index (word, '/') == NULL);
  2868.       looking_for_command &= (*word != '~') && (index (word, '/') == NULL);
  2869.   
  2870. ***************
  2871. *** 206,212
  2872.   
  2873.       dot_got = FALSE;
  2874.       stat (".", &dot_statb);
  2875.       if (looking_for_lognames) {            /* Looking for login names? */
  2876.       setpwent ();                /* Open passwd file */
  2877.       copyn (name, &word[1], MAXNAMLEN);    /* name sans ~ */
  2878.  
  2879. --- 205,210 -----
  2880.   
  2881.       dot_got = FALSE;
  2882.       stat (".", &dot_statb);
  2883.       if (looking_for_lognames) {            /* Looking for login names? */
  2884.       setpwent ();                /* Open passwd file */
  2885.       copyn (name, &word[1], MAXNAMLEN);    /* name sans ~ */
  2886. *** tw.spell.c    Thu Sep 24 15:24:53 1987
  2887. --- /usr/src/local/tcsh/tw.spell.c    Mon Aug 17 23:00:23 1987
  2888. ***************
  2889. *** 1,4
  2890. - #include "sh.h"
  2891.   #define MAKE_TWENEX
  2892.   #include "tw.h"
  2893.   
  2894.  
  2895. --- 1,3 -----
  2896.   #define MAKE_TWENEX
  2897.   #include "tw.h"
  2898.   
  2899. SHAR_EOF
  2900. fi
  2901. exit 0
  2902. #    End of shell archive
  2903.